package com.binguo.api.baidu;

import com.baidu.aip.imagesearch.AipImageSearch;

import java.util.HashMap;
import java.util.Map;

public class BaiduSample {
    //设置APPID/AK/SK
    private static String appid = "16805085";
    private static String apiKey = "3t7PQUPeThDcPyEpUNh8UHZA";
    private static String securityKey = "SciYNqyHOip2GnS5jDjw5nCgeaqFA85w";



    /*
    private static String appid = "16799576";
    private static String apiKey = "yjMk5nNCXrypph2OsD5uFiOG";
    private static String securityKey = "zsrYkcz3fX3ZGz28ZAgusPP8T6elKHqO";
*/
/*


    private static String appid = "16809521";
    private static String apiKey = "vX13RxRaxmkGUq6fByb6oESn";
    private static String securityKey = "GXhsGrVnaevZEexgluXqoVGpOj2GamxV";

*/


    public static void main(String[] args) {
        // 初始化一个AipImageClassifyClient
        AipImageSearch client = new AipImageSearch(appid, apiKey, securityKey);

        // 可选：设置网络连接参数
        client.setConnectionTimeoutInMillis(2000);
        client.setSocketTimeoutInMillis(60000);

        HashMap<String, String> option = new HashMap<>();
        option.put("sub_lib", appid);
        option.put("brief", "11");

//        System.out.println(client.sameHqSearch("/Users/jay/IdeaProjects/binguo/api/target/1563161370392.jpg", null));
//        System.out.println(client.sameHqAdd("/Users/jay/IdeaProjects/binguo/api/target/1563161370392.jpg", option));
//        System.out.println(client.sameHqAdd("/Users/jay/IdeaProjects/binguo/api/target/1563161194840.jpg", option));
        System.out.println(client.productAdd("/Users/jay/IdeaProjects/binguo/api/target/1563157559577.jpg", option));

        /**
         * {"log_id":4076255362284549455,"cont_sign":"523017420,3964281585"}
         */

    }
}
